﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ObjectHierarchicalDataSource.aspx.cs" Inherits="demo.Pages.ObjectHierarchicalDataSource" %>

<%@ Register Assembly="Water" Namespace="Water.Web.Controls" TagPrefix="page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <page:ObjectHierarchicalDataSource ID="ObjectHierarchicalDataSource1" runat="server" TypeName="demo.Objects.BLL.China" DataIDField="id" 
            DataParentIDField="parentid" >
            <RootParameters>
                <asp:QueryStringParameter Name="id" QueryStringField="parentid" DefaultValue="0" />
            </RootParameters>
        </page:ObjectHierarchicalDataSource>
        <table>
            <tr>
                <td valign="top">
                    <fieldset>
                        <legend>ObjectHierarchicalDataSource</legend>
                        <ul>
                            <li>分层数据绑定控件（如 TreeView、Menu）可以绑定到的分层数据源</li>
                            <li>可方便的对root根节点进行参数控制(RootParameters)</li>
                            <li>可方便的对数据查询进行参数控制(SelectParameters)</li>
                            <li>支持继承与System.Web.UI.WebControls.Parameter的参数（如QueryStringParameter等）</li>
                        </ul>
                    </fieldset>
                </td>
                <td valign="top">
                    <page:Container ID="Container1" runat="server" Promptable="false" TitleText="数据来源于ObjectHierarchicalDataSource控件" Height="600" PackageType="Table">
                        <ItemTemplate>
                            <page:TreeView ID="TreeView1" runat="server" DataSourceID="ObjectHierarchicalDataSource1" ExpandDepth="1" ImageSet="Arrows"
                                IsCallBack="false">
                                <DataBindings>
                                    <asp:TreeNodeBinding TextField="name" PopulateOnDemand="true" ToolTipField="name" ValueField="id" SelectAction="Select" />
                                </DataBindings>
                            </page:TreeView>
                        </ItemTemplate>
                    </page:Container>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
